package model

import (
	"gorm.io/gorm"
	"time"
)

type BaseModel struct {
	ID        int32     `gorm:"primarykey"`
	CreatedAt time.Time `gorm:"column:created_time"`
	UpdatedAt time.Time `gorm:"column:updated_time"`
	DeletedAt gorm.DeletedAt
}

type User struct {
	BaseModel
	Mobile   string     `gorm:"index:index_mobile;unique;type:varchar(11);not null comment '手机号'"`
	Password string     `gorm:"type:varchar(100);not null comment '密码'"`
	NickName string     `gorm:"type:varchar(20) comment '昵称'"`
	Birthday *time.Time `gorm:"type:datetime comment '生日'"`
	Gender   string     `gorm:"type:varchar(6);default:'male';comment '男 male 女female'"`
	Role     int        `gorm:"default:1;type:tinyint(2) comment '1 表示普通用户  2管理员'"`
}
